package net.huashitong.supervision.task.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.supervision.task.dao.TaskCategoryLogDao;
import net.huashitong.supervision.task.entity.TaskCategoryLog;
import net.huashitong.supervision.task.filter.LogFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2020/1/13
 * Time: 19:46
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
public class TaskCategoryLogService extends StringPKService<TaskCategoryLog> {
    @Autowired
    private TaskCategoryLogDao taskCategoryLogDao;
    @Autowired
    private SysTableService tableService;

    public  List<TaskCategoryLog> queryFilter(LogFilter filter) {
        return taskCategoryLogDao.queryFilter(filter);
    }

    @Override
    protected BaseDao<TaskCategoryLog, String> getDao() {
        return taskCategoryLogDao;
    }

    @Override
    protected void beforeSave(TaskCategoryLog obj) {
        obj.setSysId(tableService.updateMaxSysId("t_task_category_log", null));
    }
}
